﻿using ARchGL.Platform.Organizations.Dto;
using System;
using System.Collections.Generic;
using System.Linq;

namespace ARchGL.Platform.Authorization.Users.Dto
{
    public class GetUserForEditOutput
    {
        public Guid? ProfilePictureId { get; set; }

        public UserEditDto User { get; set; }

        public UserRoleDto[] Roles { get; set; }

        public List<OrganizationUnitDto> AllOrganizationUnits { get; set; }

        private List<string> memberedOrganizationUnits;
        public List<string> MemberedOrganizationUnits
        {
            get
            {
                return memberedOrganizationUnits?.OrderBy(s => s?.ToString()).ThenBy(x => x?.ToString().Length).ToList();
            }
            set => memberedOrganizationUnits = value;
        }

        public string ProfilePicture { get; set; }
        //public List<string> MemberedOrganizationUnits { get; set; }
    }
}